<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
  <script>
    // 数据筛选
    // axios.get('https://cdn.liyanhui.com/data.json',{
    //   params: {
    //     id: 19,
    //     status: 1,
    //   }
    // }).then(res => {
    //   console.log(res.data)
    // })

    // 并发
    // axios.all([
    //   axios({
    //     url: 'https://cdn.liyanhui.com/data.json',
    //     data: '1.异步'
    //   }),
    //   axios({
    //     url: 'https://cdn.liyanhui.com/data.json',
    //     data: '2.异步'
    //   }),
    //   axios({
    //     url: 'https://cdn.liyanhui.com/data.json',
    //     data: '3.异步'
    //   }),
    // ]).then(value => {
    //   for(let i=0; i<value.length; i++){
    //     console.log(value[i].config.data)
    //   }
    // })

    axios.all([
      axios({
        url: 'https://cdn.liyanhui.com/data.json',
        data: '1.异步'
      }),
      axios({
        url: 'https://cdn.liyanhui.com/data.json',
        data: '2.异步'
      }),
      axios({
        url: 'https://cdn.liyanhui.com/data.json',
        data: '3.异步'
      }),
    ]).then(axios.spread((res1, res2, res3) => {
      console.log(res1);
      console.log(res2);
      console.log(res3);
    }))
  </script>
</body>
</html>